{% extends 'base.html' %}
{% block title %}社团列表{% endblock %}
{% block page_header %}
    <h1 class="title">社团管理</h1>
    <ol class="breadcrumb">
        <li><a href="index.html">社团管理</a></li>
        <li class="active">社团列表</li>
    </ol>
{% endblock %}


{% block main_content %}

    <div class="col-md-12">
        <div class="panel panel-default">
            <div class="panel-title">
                社团管理
            </div>
            <div class="panel-body table-responsive">
                <table class="table table-hover">
                    <thead>
                    <tr class="text-center">
                        <td>社团ID</td>
                        <td>社团名称</td>
                        <td>社团指导师</td>
                        <td>社团社长</td>
                        <td>社团描述</td>
                        <td>操作</td>
                    </tr>
                    </thead>
                    <tbody>
                    {% for one_club in all_club %}
                        <tr class="text-center">
                            <td>{{ one_club.id }}</td>
                            <td>{{ one_club.name }}</td>
                            <td>{{ one_club.teacher }}</td>
                            <td>{{ one_club.president }}</td>
                            <td>{{ one_club.describe }}</td>
                            <td>
                                <a href="{{ url_for('show_club',club_id=one_club.id) }}"
                                   class="btn btn-sm btn-info">查看</a>
                                {% if list_type != 'join' and g.user.role_permission != 3 %}
                                    <a href="{{ url_for('edit_club',club_id=one_club.id) }}"
                                       class="btn btn-sm btn-warning">编辑</a>
                                    <a href="{{ url_for('delete_club',club_id=one_club.id) }}"
                                       class="btn btn-sm btn-danger">删除</a>
                                {% endif %}
                            </td>
                        </tr>
                    {% endfor %}
                    </tbody>
                </table>
            </div>

        </div>
    </div>
    <!-- End Panel -->
{% endblock %}